<?php

class MenuNOBODY extends Node
{

    protected $username;

    function setFormData( $name, $pass )
    {
        if ( empty( $name ) ) $this->errors[ ] = 'username';

        if ( empty( $pass ) ) $this->errors[ ] = 'password';

        $this->username = $name;

        if ( !User::authenticate( 'password=MD5(' . MyLink::quote( $pass ) . ') AND username=' . MyLink::quote( $name ) ) ) {
            $this->errors[ ] = 'password';
            $this->errors[ ] = 'username';
        }
    }

    function handlePOST( Event $e )
    {
        if ( $e->tag == 'login' )
                $this->_setFormData( $_POST[ 'username' ], $_POST[ 'password' ] );
    }

}

?>
